<template>
	<view>
		<view style="padding:20rpx">
			<view style="font-size: 32rpx;font-weight: bold;margin-top: 60rpx ;padding: 20rpx 0;">
				智能燃气设备
			</view>
			<view v-for="(item,index)  in hongmengList" :key="index"
				style="font-size: 30rpx; background-color: #efefef;padding: 20rpx;margin-bottom: 20rpx; border-radius: 6rpx;">
				<view style="padding: 6rpx 0;">
					房间名称 ：  {{item.roomName}}
				</view>
				<view style="padding: 6rpx 0;">
					设备编号 ：  {{item.deviceId}}
				</view>
				<view style="padding: 6rpx 0;">
					设备名称 ： {{item.deviceName}}
				</view>
				<view style="padding: 6rpx 0;"> 
					<view style="">
						设备状态 ：     <view v-if="false"
							style="margin-left:4rpx;border:1rpx solid #ff0000;color:#ff0000;display: inline-block;padding:6rpx 10rpx;border-radius: 6rpx;font-size:28rpx">
							已关闭
						</view>
						<view v-else
							style="margin-left:4rpx;color:#00aa00;display: inline-block;padding:6rpx 10rpx;border-radius: 6rpx;font-size:28rpx">
							已打开
						</view>
						<view style="float:right;margin-left:4rpx;border:1rpx solid #00aa00;color:#00aa00;display: inline-block;padding:6rpx 10rpx;border-radius: 6rpx;font-size:28rpx">
							远程关闭
						</view>
					</view>
				</view>
			</view>
		</view>
		<!--  -->
	</view>
</template>

<script>
	export default {
		data() {
			return {
				hongmengList: []
			}
		},
		onLoad() {
			this.getMyDevice()
		},
		methods: {
			getMyDevice() {
				uni.showLoading({
					title: '加载中'
				})
				this.$http.post('/hongmeng/device/list', {
					residentId: uni.getStorageSync('userInfo').id
				}).then(res => {
					if (res.code == 10000) {
						this.hongmengList = res.data.list || []
					}
				})
			}
		}
	}
</script>

<style>

</style>
